#include <pthread.h>
#include "ptfifi.h"


#define NB_TEST 10

int RESULTS_VAL[NB_TEST];
float RESULTS_TIME[NB_TEST];
float RESULTS_THREAD[NB_TEST];


void test (int fibo, int running_test){
	RESULTS_VAL[running_test] = fibo;
	float* result=ptaffichage(fibo);
	RESULTS_TIME[running_test] = result[0];
	RESULTS_THREAD[running_test] = result[1];
}

void ecrire_fichier(char* Name){
 
// Ouverture  
	int i;
	int f = fopen(Name, "w+" ) ; 

	for (i=0; i<NB_TEST;i++){
		fprintf(f,"%d %g %g\n",RESULTS_VAL[i],RESULTS_TIME[i],RESULTS_THREAD[i]);
	}
	close(f);
}



int main (int argc,char **argv){
	int i = 0;
  	int fibo=0;
  	for (i=0; i<NB_TEST; i++){
  		printf("Entrer un entier : \n");
  		scanf("%d", &fibo);
  		test(fibo,i); 		
  	}
	ecrire_fichier("test_ptfibo.txt");
  	return EXIT_SUCCESS;
}
